import { request } from 'umi';
// 获取分类列表
export function getArticleCommentList(payload:any) {
  let params = {
    page:payload.page,
    pageSize:payload.pageSize,
    title:payload.title,
    status:payload.status,
    category:payload.category,
  };
  return request('/api/article', {
    params,
  });
}
// 编辑页面数据
export function getArticleEditorId(id: string) {
  return request(`/api/article/${id}`);
}
// 批量发布
export function setArticleCommentList(payload:any){
  return request(`/api/article/${payload.id}`,{
    method:"PATCH",
    data:{
      status: payload.status
    }
  })
}
// 批量首焦推荐
export function setArticleCommentListRecommend(payload:any){
  console.log(payload);
  
  return request(`/api/article/${payload.id}`,{
    method:"PATCH",
    data:{
      isRecommended: payload.isRecommended
    }
  })
}

// 批量删除
export function delArticleCommentList(payload:any){
  return request(`/api/article/${payload.id}`,{
    method:"DELETE",
  })
}